package cn.lyw.discount.service.service;

import cn.common.restresult.util.RestResult;
import cn.lyw.discount.service.bo.AddAdminDiscountBO;
import cn.lyw.discount.service.bo.DelAdminDiscountBO;
import cn.lyw.discount.service.bo.EditAdminDiscountBO;
import cn.lyw.discount.service.bo.GetAdminDiscountByStateBO;
import cn.lyw.discount.service.domain.GetAdminDiscountAllDO;
import cn.lyw.discount.service.domain.GetAdminDiscountByIdDO;
import cn.lyw.discount.service.domain.GetAdminDiscountByStateDO;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author lyw
 * @Description 后台优惠券
 * @Date 16:03 2021/7/18
 * @Param
 * @return
 */
@FeignClient(value = "user-information-provider-server")
@Component
public interface AdminDiscountService {


    /**
     * @return
     * @Author lyw
     * @Description 查询全部的优惠券
     * @Date 16:05 2021/7/18
     * @Param
     */
    @PostMapping("/adminDiscount/getAdminDiscountAll")
    RestResult<List<GetAdminDiscountAllDO>> getAdminDiscountAll();


    /**
     * @return
     * @Author lyw
     * @Description 根据优惠券状态查询
     * @Date 8:37 2021/7/20
     * @Param
     */
    @PostMapping("/adminDiscount/getAdminDiscountByState")
    RestResult<List<GetAdminDiscountByStateDO>> getAdminDiscountByState(GetAdminDiscountByStateBO bo);


    /**
     * @return
     * @Author lyw
     * @Description 根据优惠券id查询优惠券信息
     * @Date 16:54 2021/7/20
     * @Param
     */
    @PostMapping("/adminDiscount/getAdminDiscountById")
    RestResult<GetAdminDiscountByIdDO> getAdminDiscountById(@RequestParam String discountId);


    /**
     * @return
     * @Author lyw
     * @Description 修改优惠券
     * @Date 8:47 2021/7/20
     * @Param
     */
    @PostMapping("/adminDiscount/editAdminDiscount")
    RestResult editAdminDiscount(@RequestBody EditAdminDiscountBO bo);


    /**
     * @return
     * @Author lyw
     * @Description 添加优惠券
     * @Date 8:56 2021/7/20
     * @Param
     */
    @PostMapping("/adminDiscount/addAdminDiscount")
    RestResult addAdminDiscount(@RequestBody AddAdminDiscountBO bo);


    /**
     * @return
     * @Author lyw
     * @Description 删除优惠券
     * @Date 8:58 2021/7/20
     * @Param
     */
    @PostMapping("/adminDiscount/delAdminDiscount")
    RestResult delAdminDiscount(@RequestBody DelAdminDiscountBO bo);

}
